<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登陆</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("form").submit(function() {
			var username = $(".username").val();
			var pwd = $(".pwd").val();
			if (username == "") {
				alert("用戶名不能爲空");
				return false;
			}
			if (pwd == "") {
				alert("密碼不能爲空");
				return false;
			}
			return true;
		});

		/* 		$(".login").click(function(){
				 		var username = $(".username").val();
					var pwd = $(".pwd").val();
				$.ajax({
					url : "login.action",
					data : {
						username : $(".username").val(),
						password : $(".pwd").val()
					},
					type : "post",
					datatype : "json",
					success : function(data, status, response) {

					},
					error : function() {
						alert("");
					}
				})
			}) */

	})
</script>

</head>

<body style="background-color: azure;">

	<%
		String login = (String) request.getSession().getAttribute("login");
		String val = "";
		if ("false".equals(login)) {
			val = "用户名或密码错误";
			request.getSession().removeAttribute("login");
		}
	%>

	<div align="center" style="margin-top: 200px;">


		<form action="login" method="post">
			管理员：<input type="radio" name="type" value="employee"
				checked="checked"><br> 学生：<input type="radio"
				name="type" value="student"><br>

			<p>用户名</p>
			<input name="username" class="username"><br>
			<p>密码</p>
			<input name="password" type="password" class="pwd"><br>
			<p></p>
			<input type="submit" value="登陆" class="login">
		</form>
		<p><%=val%></p>


	</div>
</body>
</html>

